home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 6.4 KB | 150 lines | [TEXT/MPS ] |
- (*
- File: GXMath.mod
-
- Contains: QuickDraw GX math routine interfaces.
-
- Version: Technology: Quickdraw GX 1.1
- Package: Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE GXMath;
-
- IMPORT SYSTEM, Types;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
- (*$SET mathTypesIncludes TRUE*)
-
- TYPE
- gxPointPtr* = POINTER TO gxPoint;
- gxPoint* = RECORD
- x*: Types.Fixed;
- y*: Types.Fixed;
- END;
-
- gxColorValue* = INTEGER;
-
- gxPolarPtr* = POINTER TO gxPolar;
- gxPolar* = RECORD
- radius*: Types.Fixed;
- angle*: Types.Fixed;
- END;
-
- gxMappingPtr* = POINTER TO gxMapping;
- gxMapping* = RECORD
- map*: ARRAY 3,3 (*ΔΔ[0..2,0..2]ΔΔ*) OF Types.Fixed;
- END;
-
-
- CONST
- gxColorValue1* = $0000FFFF; (* gxColorValue 1.0 *)
- gxPositiveInfinity* = $7FFFFFFF; (* for Types.Fixed and Types.Fract *)
- gxNegativeInfinity* = $80000000; (* for Types.Fixed and Types.Fract *)
-
- (*$SET mathRoutinesIncludes TRUE*)
-
- PROCEDURE CopyToMapping*(VAR target: gxMapping; (*CONST*)VAR source: gxMapping): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE InvertMapping*(VAR target: gxMapping; (*CONST*)VAR source: gxMapping): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE MapMapping*(VAR target: gxMapping; (*CONST*)VAR source: gxMapping): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE MoveMapping*(VAR target: gxMapping; hOffset: Types.Fixed; vOffset: Types.Fixed): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE MoveMappingTo*(VAR target: gxMapping; hPosition: Types.Fixed; vPosition: Types.Fixed): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE NormalizeMapping*(VAR target: gxMapping): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE RotateMapping*(VAR target: gxMapping; angle: Types.Fixed; xCenter: Types.Fixed; yCenter: Types.Fixed): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE ScaleMapping*(VAR target: gxMapping; hFactor: Types.Fixed; vFactor: Types.Fixed; xCenter: Types.Fixed; yCenter: Types.Fixed): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE ResetMapping*(VAR target: gxMapping): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE SkewMapping*(VAR target: gxMapping; skewX: Types.Fixed; skewY: Types.Fixed; xCenter: Types.Fixed; yCenter: Types.Fixed): gxMappingPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE MapPoints*((*CONST*)VAR source: gxMapping; count: LONGINT; vector: gxPoint); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FirstBit*(x: LONGINT): INTEGER; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideScale*((*CONST*)VAR source: Types.wide): INTEGER; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE LinearRoot*(first: Types.Fixed; last: Types.Fixed; t: Types.Fract): INTEGER; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE QuadraticRoot*(first: Types.Fixed; control: Types.Fixed; last: Types.Fixed; t: Types.Fract): INTEGER; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE PolarToPoint*((*CONST*)VAR ra: gxPolar; VAR xy: gxPoint): gxPointPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE PointToPolar*((*CONST*)VAR xy: gxPoint; VAR ra: gxPolar): gxPolarPtr; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FractCubeRoot*(source: Types.Fract): Types.Fract; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FractDivide*(dividend: Types.Fract; divisor: Types.Fract): Types.Fract; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FractMultiply*(multiplicand: Types.Fract; multiplier: Types.Fract): Types.Fract; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FractSineCosine*(degrees: Types.Fixed; VAR cosine: Types.Fract): Types.Fract; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FractSquareRoot*(source: Types.Fract): Types.Fract; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FixedDivide*(dividend: Types.Fixed; divisor: Types.Fixed): Types.Fixed; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE FixedMultiply*(multiplicand: Types.Fixed; multiplier: Types.Fixed): Types.Fixed; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- (* This next call is (source * multiplier / divisor) -- it avoids underflow, overflow by using wides *)
- PROCEDURE MultiplyDivide*(source: LONGINT; multiplier: LONGINT; divisor: LONGINT): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE Magnitude*(deltaX: LONGINT; deltaY: LONGINT): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE VectorMultiplyDivide*(count: LONGINT; (*CONST*)VAR vector1: LONGINT; step1: LONGINT; (*CONST*)VAR vector2: LONGINT; step2: LONGINT; divisor: LONGINT): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- (* wide operations are defined within FixMath.h only for PowerPC *)
- (*$IF NOT GENERATINGPOWERPC *)
- PROCEDURE WideAdd*(VAR target: Types.wide; (*CONST*)VAR source: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideCompare*((*CONST*)VAR target: Types.wide; (*CONST*)VAR source: Types.wide): INTEGER; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideNegate*(VAR target: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideShift*(VAR target: Types.wide; shift: LONGINT)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideSquareRoot*((*CONST*)VAR source: Types.wide): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideSubtract*(VAR target: Types.wide; (*CONST*)VAR source: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE WideMultiply*(multiplicand: LONGINT; multiplier: LONGINT; VAR target: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- (* returns the quotient *)
- PROCEDURE WideDivide*((*CONST*)VAR dividend: Types.wide; divisor: LONGINT; VAR remainder: LONGINT): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- (* quotient replaces dividend *)
- PROCEDURE WideWideDivide*(VAR dividend: Types.wide; divisor: LONGINT; VAR remainder: LONGINT)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- (*$END*)
- PROCEDURE VectorMultiply*(count: LONGINT; (*CONST*)VAR vector1: LONGINT; step1: LONGINT; (*CONST*)VAR vector2: LONGINT; step2: LONGINT; VAR dot: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE RandomBits*(count: LONGINT; focus: LONGINT): LONGINT; (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE SetRandomSeed*((*CONST*)VAR seed: Types.wide); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
- PROCEDURE GetRandomSeed*(VAR seed: Types.wide)(*ΔΔ : Types.wide*); (*ΔΔC;ΔΔ*)
- EXTERNAL (*•• C*);
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END GXMath.
-